import 'dart:typed_data';
import 'package:bluetooth_parse_plugin/src/base/crypto_base.dart';

// Lorin密钥
class LorinCrypto extends LxCryptoBase {

  @override
  int get notCryptoPrefixLength => 4;

  @override
  int get notCryptoSuffixLength => 0;

  @override
  int? get randCryptKeyIndex => 3;

  @override
  int? get escapeByte => 0xA5;

  @override
  Uint8List? get needEscapeBytes => Uint8List.fromList([0xAA, 0xA5]);

  @override
  bool get needCrypto => false;

  @override
  Uint8List? get cryptoAes => Uint8List.fromList([
        0xA2,
        0x3C,
        0xBC,
        0x5F,
        0x11,
        0x4B,
        0xA1,
        0xD5,
        0x42,
        0x26,
        0xE6,
        0x39,
        0x9E,
        0xB3,
        0x2F,
        0xD1
      ]);

  @override
  Uint8List? get cryptoTable => Uint8List.fromList(
        [
          0xED,
          0xB9,
          0xF2,
          0x58,
          0x8B,
          0xE3,
          0xC5,
          0xEC,
          0x14,
          0xC0,
          0x9D,
          0x42,
          0x60,
          0x17,
          0x0F,
          0x9E,
          0x0B,
          0x98,
          0xDC,
          0x16,
          0x9D,
          0xDF,
          0x66,
          0xD1,
          0xC3,
          0x9C,
          0xC7,
          0xBF,
          0x4D,
          0xFD,
          0xBD,
          0xCE,
          0xEB,
          0x95,
          0xE6,
          0x96,
          0x25,
          0x4F,
          0xA8,
          0x8D,
          0x52,
          0x49,
          0x96,
          0xD0,
          0xC2,
          0x80,
          0xBB,
          0xCC,
          0x90,
          0x02,
          0x09,
          0x3E,
          0x1E,
          0x7B,
          0x39,
          0xF3,
          0x47,
          0x4A,
          0x20,
          0x00,
          0x6F,
          0x9B,
          0x2F,
          0xA9,
          0x1A,
          0x50,
          0xA2,
          0x0E,
          0x06,
          0x21,
          0x9C,
          0xFB,
          0x1E,
          0x59,
          0x76,
          0x4A,
          0x83,
          0xD3,
          0xCA,
          0x4D,
          0xDC,
          0xFB,
          0x31,
          0xC2,
          0xA6,
          0xDE,
          0x14,
          0x11,
          0x60,
          0x99,
          0x3E,
          0xC6,
          0x7A,
          0x41,
          0xC5,
          0x5B,
          0xF6,
          0xCB,
          0xD9,
          0x4D,
          0x4F,
          0x62,
          0x2B,
          0x15,
          0x3D,
          0xAF,
          0x4D,
          0xCB,
          0x7A,
          0x6D,
          0x32,
          0x40,
          0xAD,
          0x38,
          0xE7,
          0x7A,
          0x3B,
          0x1D,
          0x25,
          0x19,
          0x3D,
          0x3E,
          0xF4,
          0xE1,
          0xD5,
          0x32,
          0x8E,
          0xF2,
          0xF1,
          0x40,
          0xA4,
          0x4E,
          0xD9,
          0x83,
          0xDC,
          0x90,
          0x44,
          0x64,
          0x6C,
          0xEB,
          0x02,
          0xCC,
          0xA6,
          0x6E,
          0x6E,
          0x2B,
          0x6F,
          0x8B,
          0x67,
          0x09,
          0x3B,
          0xD2,
          0x4E,
          0x8C,
          0x3F,
          0x95,
          0x99,
          0x9C,
          0xC5,
          0x66,
          0x67,
          0x7B,
          0xA5,
          0xD7,
          0xBA,
          0x89,
          0xE9,
          0x72,
          0x4D,
          0xA1,
          0xD6,
          0x57,
          0xF6,
          0x35,
          0x54,
          0x9D,
          0x2D,
          0xE0,
          0x5B,
          0x6A,
          0x68,
          0x66,
          0x05,
          0xA8,
          0x0F,
          0x07,
          0xEB,
          0xEE,
          0x56,
          0x31,
          0x77,
          0x94,
          0x05,
          0xF8,
          0x07,
          0xED,
          0xE7,
          0x87,
          0x98,
          0x3F,
          0x3E,
          0xB2,
          0xB1,
          0x31,
          0xFA,
          0x2D,
          0x94,
          0x7D,
          0x99,
          0xC6,
          0x1F,
          0x83,
          0x66,
          0xD9,
          0x11,
          0x32,
          0x15,
          0x8B,
          0xF8,
          0x04,
          0x61,
          0x8E,
          0x04,
          0x81,
          0xF0,
          0x92,
          0x80,
          0xD9,
          0x7E,
          0xB7,
          0xD4,
          0x24,
          0xD1,
          0xA4,
          0xAD,
          0x21,
          0x89,
          0x81,
          0x55,
          0x8D,
          0x50,
          0x56,
          0x6A,
          0x28,
          0xD8,
          0xD5,
          0x82,
          0x89,
          0x5A,
          0x1C,
          0xEA,
          0x42,
          0x2A,
          0x08,
          0x6A,
          0xDF,
        ],
      );
}
